-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: merge control markdown with json (#1528) #1740
base: develop
Are you sure you want to change the base?
Conversation
c191240
to
230c326
Compare
00894de
to
8e60474
Compare
Function cleanup / unit tests to follow Signed-off-by: d10n <[email protected]>
Signed-off-by: d10n <[email protected]>
PyCharm has trouble keeping the working directory consistent, so make the tests look for files relative to the test file instead of the CWD Signed-off-by: d10n <[email protected]>
Signed-off-by: d10n <[email protected]>
Signed-off-by: d10n <[email protected]>
Signed-off-by: d10n <[email protected]>
Signed-off-by: d10n <[email protected]>
8e60474
to
2068811
Compare
@@ -259,7 +259,9 @@ def tmp_empty_cwd(tmp_path: pathlib.Path) -> Iterator[pathlib.Path]: | |||
@pytest.fixture(scope='function') | |||
def testdata_dir() -> pathlib.Path: | |||
"""Return absolute path to test data directory.""" | |||
test_data_source = pathlib.Path('tests/data') | |||
test_dir = pathlib.Path(__file__).parent.resolve() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we switch to using __file__
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expanding on the commit message for the line: to enable running / debugging unit tests in PyCharm; PyCharm sets working directories for the test runner incorrectly, even when manually specified. This is a PyCharm problem, but enabling tools is good, so why not? 😃 It also enables running unit tests from any directory in the shell.
) -> None: | ||
"""Test failure modes of validation.""" | ||
test_data_dir = testdata_dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use test_data_dir
as the parameter name and remove this statement? Or use testdata_dir
in the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this is messy. I did this to keep the changed line count small, and I was planning to do more test clean-up in a dedicated PR, but I can fix this now.
edit: I realized I didn't finish answering: the test function parameter name is associated with the fixture function name in conftest.py. The test function now uses the fixture, but the test code used this slightly different variable name for the same purpose.
"""Test successful validation runs.""" | ||
test_data_dir = testdata_dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use test_data_dir as the parameter name and remove this statement? Or use testdata_dir
in the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test case that demonstrates the failure before this PR that now passes?
Yes, looks like I dropped it in my previous rebasing. I'll include it along with the requested test_data_dir update |
Types of changes
develop
->main
)Quality assurance (all should be covered).
Summary
Key links:
Before you merge